package com.yywz.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;

public class CalendarTest {

	public static void main(String[] args) throws ParseException {
		
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		
		SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
		
		Calendar calendar = Calendar.getInstance();
		
		calendar.set(Calendar.DAY_OF_WEEK, calendar.getActualMinimum(Calendar.DAY_OF_WEEK));
		
		System.out.println(sdf.format(calendar.getTime()));
		
		System.out.println(sdf2.parse(sdf.format(calendar.getTime()) + " 00:00:00.000"));
		
		System.out.println(sdf2.parse("2012-11-04" + " 00:00:00.000"));
	}

}
